package com.student.demo.controller;

import com.student.demo.entiy.Student;
import com.student.demo.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@CrossOrigin
public class StudentController {
    @Autowired// 自动导入
    private StudentService studentService;

    @PostMapping("/addStudent")
    public void addStudent(String name, Integer age){
        studentService.addStudent(name, age);
    }

    @PostMapping("/queryStudent")
    public String queryStudent() {
        return "chj";
    }

    @RequestMapping("/Test")
    public String getTest() {
        return "lianjie";
    }
}
